﻿using BootstrapBlazor.Components;
using Microsoft.AspNetCore.Components;
using System.Diagnostics.CodeAnalysis;

namespace BBCore.Server.Components.Pages.Admins
{
    public partial class Dispatch
    {
        [Inject]
        [NotNull]
        private IDispatchService<string>? DispatchService { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        private string? TitleHead { get; set; } = "通知";
        /// <summary>
        /// 内容
        /// </summary>
        private string? TitleBody { get; set; }

        private async Task OnDispatch()
        {

            DispatchService.Dispatch(new DispatchEntry<string>()
            {
                Name = TitleHead,
                Entry = TitleBody
            });
            await Task.Delay(3 * 1000);//等待3秒

        }
    }

}
